import StringUtils from "utils/StringUtils.js";

const modules = [
	require.context("tinymce/plugins/", true, /\.js$/),
	require.context("@/common/tinymces/plugins/", true, /\.js$/)
];

let pluginNames = [];
let ignore = ["emoticons", "colorpicker", "contextmenu", "textcolor"];
modules.forEach(element => {
	element.keys().forEach(item => {
		if (/index\.\w+$/.test(item)) {
			//获取组件名称
			let pluginName = StringUtils.subString(item);
			if (!ignore.includes(pluginName)) {
				pluginNames.push(pluginName);
			}
		}
	});
});

export default pluginNames;
